package com.google.code.sharecontent.dao.impl;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

import com.google.code.sharecontent.dao.UserGroupsDao;
import com.google.code.sharecontent.model.UserGroups;

public class UserGroupsDaoImpl extends BaseDaoImpl<UserGroups> implements UserGroupsDao {

	public UserGroupsDaoImpl(Connection conn) {
		super(conn);
	}

	@Override
	public UserGroups createByRow(ResultSet rs) throws SQLException {
		UserGroups userGroups = new UserGroups();
		userGroups.setId(rs.getInt("ID"));
		userGroups.setUserId(rs.getInt("USER_ID"));
		userGroups.setGroupId(rs.getInt("GROUP_ID"));;
		return userGroups;
	}

	@Override
	protected String getTableName() {
		return "USER_GROUPS";
	}

	@Override
	protected PreparedStatement putPrepareStatement(PreparedStatement pStat,
			UserGroups status) throws SQLException {
		// TODO Auto-generated method stub
		return pStat;
	}

}
